<template>
  <el-pagination
    v-if="total"
    background
    layout="prev, pager, next"
    :total="total"
    :page-size="pageSize"
    :current-page="currentPage"
    @current-change="$emit('current-change', $event)"
    class="vc-pagination">
  </el-pagination>
</template>

<script>
  /**
   * 分页组件
   * props
   *    total 总记录数
   *    pageSize  分页大小
   *    currentPage 当前页
   * events
   *    current-change  分页改变
   * 示例：<vc-pagination :total="" :page-size="" :current-page="" @current-change=""></vc-pagination>
   */
  export default {
    name: 'Pagination',
    props: {
      total: {},
      pageSize: {},
      currentPage: {
        type: Number,
        default: 1
      }
    }
  }
</script>

<style lang="scss">
  .vc-pagination {
    margin-top: 20px;
  }
</style>